<?php


namespace App\Admin\Controller\Wechat;


use App\Admin\Controller\AdminBaseController;
use App\Admin\Requests\Wechat\MiniProgramDraftToTemplateRequest;
use App\Admin\Services\Wechat\MiniProgramDraftService;
use Illuminate\Http\Request;

class MiniProgramDraftController extends AdminBaseController {
    private $_service;

    public function __construct(MiniProgramDraftService $service) {
        $this->_service = $service;
    }

    /**
     * 代码草稿分页列表
     *
     * @param Request $request
     * @return mixed
     */
    public function page(Request $request) {
        return $this->success($this->_service->page($request));
    }

    /**
     * 代码草稿添加至代码模板库
     *
     * @param MiniProgramDraftToTemplateRequest $request
     * @return mixed
     */
    public function miniProgramDraftToTemplate(MiniProgramDraftToTemplateRequest $request) {
        return $this->success($this->_service->miniProgramDraftToTemplate($request));
    }
}